<?php
	defined('_JEXEC') or die('Restricted access');

	$db = JFactory::getDBO();

	$query = 'SELECT a.article_image,cc.title AS category, a.id, a.title, a.alias, a.title_alias, a.introtext, a.fulltext, a.sectionid, a.state, a.catid, a.created, a.created_by, a.created_by_alias, a.modified, a.modified_by,' .
	' a.checked_out, a.checked_out_time, a.publish_up, a.publish_down, a.attribs, a.hits, a.images, a.urls, a.ordering, a.metakey, a.metadesc, a.access,' .
	' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug,'.
	' CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(":", cc.id, cc.alias) ELSE cc.id END as catslug,'.
	' CHAR_LENGTH( a.`fulltext` ) AS readmore, u.name AS author, u.usertype, g.name AS groups FROM #__content AS a' .
	' LEFT JOIN #__categories AS cc ON a.catid = cc.id' .
	' LEFT JOIN #__users AS u ON u.id = a.created_by' .
	' LEFT JOIN #__groups AS g ON a.access = g.id WHERE a.id = 5 and a.state >=0 ';
	
	$db->setQuery( $query );
	$item = $db->loadObject(); 
	echo $item->introtext;
?>